﻿<?xml version="1.0" encoding="utf-8"?>
<xsd:schema id="SalamancaActivityModelLanguageSchema" targetNamespace="http://schemas.microsoft.com/dsltools/SalamancaActivityModelLanguage" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/dsltools/SalamancaActivityModelLanguage" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <!-- ActivityModel -->
  <xsd:element name="activityModel" type="ActivityModel" />
  <xsd:complexType name="ActivityModel">
    <xsd:annotation>
      <xsd:documentation>The root in which all other elements are embedded. Appears as a diagram.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Relationship: ActivityModelHasFlowElements -->
      <xsd:element name="elements" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Instances of ActivityModelHasFlowElements</xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="unbounded" >
              <xsd:element ref="activityModelHasFlowElements">
                <xsd:annotation>
                  <xsd:documentation>[Relationship deriving from ActivityModelHasFlowElements needs to be serialized in full-form]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
              <xsd:element ref="flowElement" >
                <xsd:annotation>
                  <xsd:documentation>[Target role-player]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <!-- Relationship: ActivityModelHasData -->
      <xsd:element name="data" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Instance of ActivityModelHasData</xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice minOccurs="1" maxOccurs="1" >
              <xsd:element ref="activityModelHasData">
                <xsd:annotation>
                  <xsd:documentation>[Relationship deriving from ActivityModelHasData needs to be serialized in full-form]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
              <xsd:element ref="activityData" >
                <xsd:annotation>
                  <xsd:documentation>[Target role-player]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <!-- Id -->
    <xsd:attribute name="Id" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- dslVersion -->
    <xsd:attribute name="dslVersion" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Version of the model serialized in this file.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: Name -->
    <xsd:attribute name="name" type="xsd:string" />
  </xsd:complexType>
  
  <!-- ActivityModel Moniker -->
  <xsd:element name="activityModelMoniker" type="ActivityModelMoniker" />
  <xsd:complexType name="ActivityModelMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ActivityModel instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="Id" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- FlowElement -->
  <xsd:element name="flowElement" abstract="true" type="FlowElement" />
  <xsd:complexType name="FlowElement" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>Elements embedded in the model. Appear as boxes on the diagram.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Relationship: Transition -->
      <xsd:element name="transitionTo" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Instances of Transition</xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element ref="transition" minOccurs="0" maxOccurs="unbounded">
              <xsd:annotation>
                <xsd:documentation>[Instance of Transition needs to be serialized in full-form]</xsd:documentation>
              </xsd:annotation>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- FlowElement Moniker -->
  <xsd:element name="flowElementMoniker" abstract="true" type="FlowElementMoniker" />
  <xsd:complexType name="FlowElementMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for FlowElement instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- QuestionState -->
  <xsd:element name="questionState" type="QuestionState" substitutionGroup="activityState" />
  <xsd:complexType name="QuestionState">
    <xsd:complexContent>
      <xsd:extension base="ActivityState">
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: Kind -->
        <xsd:attribute name="kind" type="QuestionKind" />
        <!-- Property: DataName -->
        <xsd:attribute name="dataName" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- QuestionState Moniker -->
  <xsd:element name="questionStateMoniker" type="QuestionStateMoniker" substitutionGroup="activityStateMoniker" />
  <xsd:complexType name="QuestionStateMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for QuestionState instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="ActivityStateMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ActionState -->
  <xsd:element name="actionState" type="ActionState" substitutionGroup="activityState" />
  <xsd:complexType name="ActionState">
    <xsd:complexContent>
      <xsd:extension base="ActivityState">
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ActionState Moniker -->
  <xsd:element name="actionStateMoniker" type="ActionStateMoniker" substitutionGroup="activityStateMoniker" />
  <xsd:complexType name="ActionStateMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ActionState instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="ActivityStateMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- StartPoint -->
  <xsd:element name="startPoint" type="StartPoint" substitutionGroup="flowElement" />
  <xsd:complexType name="StartPoint">
    <xsd:complexContent>
      <xsd:extension base="FlowElement">
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- StartPoint Moniker -->
  <xsd:element name="startPointMoniker" type="StartPointMoniker" substitutionGroup="flowElementMoniker" />
  <xsd:complexType name="StartPointMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for StartPoint instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="FlowElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- EndPoint -->
  <xsd:element name="endPoint" type="EndPoint" substitutionGroup="flowElement" />
  <xsd:complexType name="EndPoint">
    <xsd:complexContent>
      <xsd:extension base="FlowElement">
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- EndPoint Moniker -->
  <xsd:element name="endPointMoniker" type="EndPointMoniker" substitutionGroup="flowElementMoniker" />
  <xsd:complexType name="EndPointMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for EndPoint instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="FlowElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ActivityState -->
  <xsd:element name="activityState" abstract="true" type="ActivityState" substitutionGroup="flowElement" />
  <xsd:complexType name="ActivityState" abstract="true" >
    <xsd:complexContent>
      <xsd:extension base="FlowElement">
        <!-- Property: Name -->
        <xsd:attribute name="name" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ActivityState Moniker -->
  <xsd:element name="activityStateMoniker" abstract="true" type="ActivityStateMoniker" substitutionGroup="flowElementMoniker" />
  <xsd:complexType name="ActivityStateMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ActivityState instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="FlowElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ActivityData -->
  <xsd:element name="activityData" type="ActivityData" />
  <xsd:complexType name="ActivityData">
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Relationship: ActivityDataHasAttributes -->
      <xsd:element name="attributes" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Instances of ActivityDataHasAttributes</xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="unbounded" >
              <xsd:element ref="activityDataHasAttributes">
                <xsd:annotation>
                  <xsd:documentation>[Relationship deriving from ActivityDataHasAttributes needs to be serialized in full-form]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
              <xsd:element ref="dataAttribute" >
                <xsd:annotation>
                  <xsd:documentation>[Target role-player]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <!-- Id -->
    <xsd:attribute name="Id" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- ActivityData Moniker -->
  <xsd:element name="activityDataMoniker" type="ActivityDataMoniker" />
  <xsd:complexType name="ActivityDataMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ActivityData instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="Id" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- DataAttribute -->
  <xsd:element name="dataAttribute" type="DataAttribute" />
  <xsd:complexType name="DataAttribute">
    <!-- Property: Name -->
    <xsd:attribute name="name" type="xsd:string" use="required" />
    <!-- Property: Type -->
    <xsd:attribute name="type" type="xsd:string" />
    <!-- Property: Kind -->
    <xsd:attribute name="kind" type="DataKind" />
  </xsd:complexType>
  
  <!-- DataAttribute Moniker -->
  <xsd:element name="dataAttributeMoniker" type="DataAttributeMoniker" />
  <xsd:complexType name="DataAttributeMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for DataAttribute instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- ActivityModelHasFlowElements -->
  <xsd:element name="activityModelHasFlowElements" abstract="true" type="ActivityModelHasFlowElements" />
  <xsd:complexType name="ActivityModelHasFlowElements" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>Embedding relationship between the Model and Elements</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end FlowElement -->
      <xsd:element ref="flowElement" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- ActivityModelHasFlowElements Moniker -->
  <xsd:element name="activityModelHasFlowElementsMoniker" abstract="true" type="ActivityModelHasFlowElementsMoniker" />
  <xsd:complexType name="ActivityModelHasFlowElementsMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ActivityModelHasFlowElements instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- Transition -->
  <xsd:element name="transition" type="Transition" />
  <xsd:complexType name="Transition">
    <xsd:annotation>
      <xsd:documentation>Reference relationship between Elements.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end FlowElement -->
      <xsd:element ref="flowElementMoniker" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <!-- Property: Name -->
    <xsd:attribute name="name" type="xsd:string" />
  </xsd:complexType>
  
  <!-- Transition Moniker -->
  <xsd:element name="transitionMoniker" abstract="true" type="TransitionMoniker" />
  <xsd:complexType name="TransitionMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Transition instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- ActivityModelHasData -->
  <xsd:element name="activityModelHasData" abstract="true" type="ActivityModelHasData" />
  <xsd:complexType name="ActivityModelHasData" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end ActivityData -->
      <xsd:element ref="activityData" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- ActivityModelHasData Moniker -->
  <xsd:element name="activityModelHasDataMoniker" abstract="true" type="ActivityModelHasDataMoniker" />
  <xsd:complexType name="ActivityModelHasDataMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ActivityModelHasData instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- ActivityDataHasAttributes -->
  <xsd:element name="activityDataHasAttributes" abstract="true" type="ActivityDataHasAttributes" />
  <xsd:complexType name="ActivityDataHasAttributes" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end DataAttribute -->
      <xsd:element ref="dataAttribute" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- ActivityDataHasAttributes Moniker -->
  <xsd:element name="activityDataHasAttributesMoniker" abstract="true" type="ActivityDataHasAttributesMoniker" />
  <xsd:complexType name="ActivityDataHasAttributesMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ActivityDataHasAttributes instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- Enum QuestionKind -->
  <xsd:simpleType name="QuestionKind">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="GetInstance"/>
      <xsd:enumeration value="EditInstance"/>
    </xsd:restriction>
  </xsd:simpleType>
  
  <!-- Enum DataKind -->
  <xsd:simpleType name="DataKind">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="Single"/>
      <xsd:enumeration value="List"/>
    </xsd:restriction>
  </xsd:simpleType>
  
</xsd:schema>

